package com.local.es.service;

import com.local.es.pojo.Goods;
import com.local.es.pojo.GoodsESDoc;
import com.local.es.pojo.GoodsSearchParam;
import com.local.es.utils.PageResultUtil;

import java.util.List;

public interface GoodsService {

    /**
     * 查询商品列表
     * @param isDeleted
     * @return
     */
    public List<Goods> getList(Integer isDeleted, Integer page, Integer limit);

    /**
     * 新增
     * @param goods
     * @return
     */
    public Integer save(Goods goods);


    /**
     * 更新
     * @param goods
     * @return
     */
    public Integer update(Goods goods);

    /**
     * 逻辑删除
     * @param goods
     * @return
     */
    public Integer delete(Goods goods);

    /**
     * 初始化es中goods索引库的文档数据
     * @return
     */
    public Integer initESData(Integer page);


    public PageResultUtil<GoodsESDoc> searchES(GoodsSearchParam param);


    public List<String> searchSuggestion(String keyword);


    /**
     * 根据goodsId更新es
     * @param goodsId
     * @return
     */
    public Integer updateES(Integer goodsId);

    /**
     * 根据goodsId删除es
     * @param goodsId
     * @return
     */
    public Integer deleteES(Integer goodsId);


}
